package com.fs.util;

import java.io.Serializable;

public class ResponseData<T> implements Serializable {

    private Meta meta = new Meta();

    private T data;


    public ResponseData(int status, String msg, T data) {
        this.meta.setStatus(status);
        this.meta.setMsg(msg);
        this.data = data;
    }

    public ResponseData(int status, String msg) {
        this.meta.setStatus(status);
        this.meta.setMsg(msg);
    }

    public ResponseData(ResultEnums resultEnums) {
        this.meta.setStatus(resultEnums.getStatus());
        this.meta.setMsg(resultEnums.getMsg());
    }

    public ResponseData(ResultEnums resultEnums, T data) {
        this.meta.setStatus(resultEnums.getStatus());
        this.meta.setMsg(resultEnums.getMsg());
        this.data = data;
    }

    public ResponseData(ResultEnums resultEnums, T data, int total) {
        this.meta.setStatus(resultEnums.getStatus());
        this.meta.setMsg(resultEnums.getMsg());
        this.meta.setTotal(total);
        this.data = data;
    }
    public ResponseData() {
    }

    public Meta  getMeta() {
        return this.meta;
    }

    public void setMeta(Meta meta) {
        this.meta = meta;
    }


    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "ResponseData{" +
                "meta=" + meta +
                ", data=" + data +
                '}';
    }
}